#include <iostream>
#include <string>
#include <vector>

int main()
{
    std::string price_str;
    std::getline(std::cin, price_str);

    std::vector<int> prices;
    int pos = 0;
    while (1)
    {
        int idx = price_str.find(' ', pos);
        if (idx != std::string::npos)
        {
            prices.push_back(std::stoi(price_str.substr(pos, pos + idx)));
            pos = idx + 1;
        }
        else
        {
            prices.push_back(std::stoi(price_str.substr(pos, pos + idx)));
            break;
        }
    }

    std::vector<int> real_prices;
    for (int i = 0; i < prices.size(); i++)
    {
        int maxv = prices[i];
        for (int j = 1; j < prices.size(); j++)
        {
            int idx = (i + j) % prices.size();
            if (prices[i] > prices[idx])
            {
                maxv = prices[i] + prices[idx];
                break;
            }
        }
        // if (minv != prices[i])
        // {
        //     real_prices.push_back(minv + prices[i]);
        // }
        // else
        // {
        real_prices.push_back(maxv);
    }

    for (int i = 0; i < prices.size(); i++)
    {
        std::cout << real_prices[i] << std::endl;
    }

    return 0;
}